package com.qezhhnjy.demo.event.simple;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.stereotype.Component;

/**
 * @author zhaoyangfu - 2021/1/4 14:25
 */
@Component
@Slf4j
@EnableAsync
public class SimpleEvent implements ApplicationListener<ApplicationEvent> {

    @Override
    @Async
    public void onApplicationEvent(ApplicationEvent event) {
        log.info("simple event=>{}", event.getSource());
    }
}
